package com.project2.bean.vo;

import com.github.pagehelper.PageInfo;
import com.project2.bean.po.MarketCategory;
import com.project2.bean.po.MarketGoods;
import lombok.Data;

import java.util.List;

/**
 * @author ：HsDsg
 * @date ：2022/8/14 21:44
 * @description：TODO
 */

@Data
public class WxGoodsListVo {
    private Integer limit;
    private Integer  page;
    private Integer pages;
    private Integer total;
    private List<MarketCategory> filterCategoryList;
    private List<MarketGoods> list;

    public static WxGoodsListVo data(PageInfo pageInfo) {
        WxGoodsListVo wxGoodsListVo = new WxGoodsListVo();
        wxGoodsListVo.setTotal((int) pageInfo.getTotal());
        wxGoodsListVo.setLimit(pageInfo.getPageSize());
        wxGoodsListVo.setPage(pageInfo.getPageNum());
        wxGoodsListVo.setPages(pageInfo.getPages());
        return wxGoodsListVo;
    }

//       this.total((int) pageInfo.getTotal());
//            limit(pageInfo.getPageSize());
//      page(pageInfo.getPageNum());
//        pages(pageInfo.getPages());
//    }
}
